﻿using RPAVIEW.util;
using RPAVIEW.views.controlLibrary;
using RPAVIEW.views.OtherPages;
using SUNRPA.CONTROLS.IMPL.domain.flowItemParam;
using System.Windows.Controls;

namespace RPAVIEW.views.EditPage.flows.TypeWebInputN {
    /// <summary>
    /// Input.xaml 的交互逻辑
    /// </summary>
    public partial class Input:BaseParamViewAction{
        public Input() {
            InitializeComponent();
        }

        public override void UpdateSource() {
            this.webObj.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.eleImg.GetBindingExpression(Image.SourceProperty).UpdateSource();
            this.inputText.GetBindingExpression(SelVarTextBox.text).UpdateSource();
            this.append.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateSource();
        }

        /// <summary>
        /// 由于目前并没有元素库功能，所以现在所有元素操作都必须直接选择。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetElement(object sender, System.Windows.RoutedEventArgs e) {
            MainWindow main = WindowUtil.GetWindow<MainWindow>();
            WindowUtil.MinSizeWindow(main);
            GetEleWindow eleWindow = new GetEleWindow((ele)=>{
                TypeWebInputNParam param = ParamUtil.GetCurrentParam<TypeWebInputNParam>();
                param.WebEle = ele;
            });
            eleWindow.Show();
            eleWindow.RegistHotKey();
        }
    }
}
